<!DOCTYPE html>
<html>
<head>

    <title>A basic Line chart with dollar syntax example</title>
    
    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="A basic example of an RGraph Line chart that makes use of the dollar syntax to add an event listener to a single point." />
    <meta name="googlebot" content="NOODP">

    <!-- 1/3. Include the RGraph libraries -->
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.dynamic.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->

</head>
<body>

    <h1>A basic Line chart with dollar syntax example</h1>

    <!-- 2/3. This is the canvas that the graph is drawn on -->
    <canvas id="cvs" width="1000" height="250">[No canvas support]</canvas>

    <!--
        3/3. This creates and displays the graph. As it is here, you can call this from the window.onload event,
             allowing you to put it in your pages header.
    -->
    <script>
        $(document).ready(function ()
        {
            var line = new RGraph.Line({
                id: 'cvs',
                data: [4,8,3,4,6,9,5],
                options: {
                    labels: ['Pete','Lou','Pob','Luis','Barney','Fred','Wilma']
                }
            }).draw()
            
            line.$2.onclick = function (e, shape)
            {
                alert('The third point has been clicked');
            }
            
            line.$2.onmousemove = function (e, shape)
            {
                e.target.style.cursor = 'pointer';
            }
        })
    </script>

</body>
</html>